<!--
    THIS EXAMPLE WAS DOWNLOADED FROM https://echarts.apache.org/examples/zh/editor.html?c=line-stack
-->
<!DOCTYPE html>
<html style="height: 100%">
    <head>
        <meta charset="utf-8">
    </head>
    <body style="height: 100%; margin: 0">
        <div id="container" style="height: 100%"></div>

        
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js"></script>
        <!-- Uncomment this line if you want to dataTool extension
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/extension/dataTool.min.js"></script>
        -->
        <!-- Uncomment this line if you want to use gl extension
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl@2/dist/echarts-gl.min.js"></script>
        -->
        <!-- Uncomment this line if you want to echarts-stat extension
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat@latest/dist/ecStat.min.js"></script>
        -->
        <!-- Uncomment this line if you want to use map
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/map/js/china.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/map/js/world.js"></script>
        -->
        <!-- Uncomment these two lines if you want to use bmap extension
        <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=<Your Key Here>"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@{{version}}/dist/extension/bmap.min.js"></script>
        -->

        <script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};

var option;



option = {
  title: {
    text: '听力检测记录'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['初测结果', '二测结果', '三测', '四测', '五测']
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  toolbox: {
    feature: {
      saveAsImage: {}
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['125', '250', '500', '1K', '2K', '3K', '4K', '6K', '8K']
  },
  yAxis: {
    type: 'value',
    inverse:true,
    axisLabel: {
      formatter: '{value} dB'
    },
    axisPointer: {
      snap: true
    }
  },
  series: [
    {
      type: 'line',
      // data: [null, 0, 0, 0, 0, 0, 0,0,0],
      markArea: {
        data: [
          [
            {
              name: '正常',
              yAxis: '0',
              itemStyle: {
                color: '#7bd9a5',
              },
            },
            {
              yAxis: '25'
            }
          ],
          [
            {
              name: '轻度',
              yAxis: '25',
              itemStyle: {
                color: '#22c3aa'
              },
            },
            {
              yAxis: '40'
            }
          ],
          [
            {
              name: '中度',
              yAxis: '40',
              itemStyle: {
                color: '#4ea397'
              },
            },
            {
              yAxis: '60'
            }
          ],
          [
            {
              name: '重度',
              yAxis: '60',
              itemStyle: {
                color: '#999999'
              },
            },
            {
              yAxis: '80'
            }
          ],
          [
            {
              name: '极重度',
              yAxis: '80',
              itemStyle: {
                color: '#666666'
              },
            },
            {
              yAxis: '130'
            }
          ]
        ]
      }
    },
    {
      name: '初测结果',
      type: 'line',
      data: [null, 45, 60, 105, 120, 115, 110,105,100]
    },
    {
      name: '二测结果',
      type: 'line',
      data: [null, 25, 35, 58, 80, 72, 65, 85, 100]
    },
    // {
    //   name: 'Video Ads',
    //   type: 'line',
    //   stack: 'Total',
    //   data: [150, 232, 201, 154, 190, 330, 410]
    // },
    // {
    //   name: 'Direct',
    //   type: 'line',
    //   stack: 'Total',
    //   data: [320, 332, 301, 334, 390, 330, 320]
    // },
    // {
    //   name: 'Search Engine',
    //   type: 'line',
    //   stack: 'Total',
    //   data: [820, 932, 901, 934, 1290, 1330, 1320]
    // }
  ]
};

if (option && typeof option === 'object') {
    myChart.setOption(option);
}

        </script>
    </body>
</html>
    